<%@ page language="java" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/jsp/pub/include.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>贝易后台管理--题库列表</title>
    <link href="<%=request.getContextPath() %>/css/admin.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.js"></script>
    <script type="text/javascript">

        function del(id){

            location='<c:url value="/clazz/clazzLibraryList?m=del&id="/>'+id;

        }

        function changeselect(){
            var url='<c:url value="/clazz/clazzLibraryList?m=list"/>';

            if($("#clazzId").val()!=""){
                url+='&clazzId='+$("#clazzId").val();
            }
            location=url;
        }
    </script>
</head>
<body>
<div class="content">
    <jsp:include page="../pub/top.jsp"></jsp:include>
    <!--头部结束-->
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td class="left" valign="top">
                <jsp:include page="../pub/left_clazz.jsp"></jsp:include>
            </td>
            <td valign="top">
                <div id="c01">
                    <dl>
                        <dt style="padding-right:20px;">课程分类：
                            <select id="clazzId" name="clazzId" style="width:100px;" onchange="changeselect()">
                                <option value="0">全部</option>
                                <c:forEach items="${courseList}" var="course">
                                    <option value="${course.id}" ${course.id==param.clazzId?'selected=selected':''}><c:out value="${course.name}"/></option>
                                </c:forEach>
                            </select>

                        </dt>
                        <dt>关键字:<input type="text" class="qidian" id="key" name="key" value="${key}"/> </dt>
                        <dd><input type="button" value="查询" class="chaxun" onclick="search()"/></dd>
                    </dl>
                    <table width="99%" border="0" cellpadding="0" cellspacing="1" bgcolor="#dae2e5">
                        <tr>
                            <td width="10%" height="30" bgcolor="#e5edfa" align="center">序号</td>
                            <td width="10%" height="30" bgcolor="#e5edfa" align="center" style="color: #cc0000">题库ID</td>
                            <td width="15%" height="30" bgcolor="#e5edfa" align="center">名称</td>
                            <td width="5%" height="30" bgcolor="#e5edfa" align="center">课程ID</td>
                            <td width="5%" height="30" bgcolor="#e5edfa" align="center">试用题数</td>
                            <td width="10%" height="30" bgcolor="#e5edfa" align="center">类型</td>
                            <td width="10%" height="30" bgcolor="#e5edfa" align="center">操作选项</td>
                        </tr>
                        <c:choose>
                            <c:when test="${not empty libraryList}">
                                <c:forEach items="${libraryList}" var="library" varStatus="vs">
                                    <tr>
                                        <td height="30" bgcolor="#FFFFFF" align="center">
                                            <input type="checkbox" name="libraryId" value="${library.id}"/>
                                            <c:out value="${vs.index+1}"/></td>
                                        <td height="30" bgcolor="#FFFFFF" align="left" style="color: #cc0000"> <c:out value="${library.id}"/></td>
                                        <td height="30" bgcolor="#FFFFFF" align="left" > <c:out value="${library.name}"/></td>
                                        <td height="30" bgcolor="#FFFFFF" align="center"><c:out value="${library.courseId}"/></td>
                                        <td height="30" bgcolor="#FFFFFF" align="center"><c:out value="${library.trialNum}"/></td>
                                        <td height="30" bgcolor="#FFFFFF" align="center"><c:out value="${library.libraryType}"/></td>

                                        <td  height="30" bgcolor="#FFFFFF" align="center">
                                            <%--<a href="<c:url value="/admin/clazzedit?m=edit&id=${clazz.id}"/>">修改</a>--%>
                                            <a href="javascript:del(${library.id})">删除</a>
                                        </td>
                                    </tr>
                                </c:forEach>
                            </c:when>
                            <c:otherwise>
                                <tr>
                                    <td colspan="6" height="30" bgcolor="#ffffff" align="center">暂无数据</td>
                                </tr>
                            </c:otherwise>
                        </c:choose>
                    </table>
                    <%--<p><input type="checkbox" onclick="selectAll(this)"/> 全选 --%>
                    <%--<input type="button" value="删除" class="shanchu" onclick="del(0)"/></p>--%>
                    <%--<jsp:include page="/WEB-INF/jsp/pub/page.jsp"></jsp:include>--%>
                </div>
                <br />
                <br />
            </td>
        </tr>
    </table>
    <jsp:include page="../pub/foot.jsp"></jsp:include>
</div>
</body>
</html>
